﻿#region Using Statements
using System;
#endregion

namespace DirectZZT.Gameplay
{
    /// <summary>
    /// Provides tools for working with creatures.
    /// </summary>
    public static class CreatureTools
    {
        /// <summary>
        /// Defines the maximum health of a creature.
        /// </summary>
        public const int MaxHealth = 150;

        /// <summary>
        /// Changes the player's health, optionally reducing the armor.
        /// </summary>
        /// <param name="value">The amount to add or to reduce.</param>
        /// <param name="inHealth"></param>
        /// <param name="inArmor"></param>
        /// <param name="health"></param>
        /// <param name="armor"></param>
        public static void ChangeHealthOffset(int value, int inHealth, int inArmor, out int health, out int armor)
        {
            health = SetHealth(inHealth + value);

            armor = inArmor;
        }

        /// <summary>
        /// Sets the player's health.
        /// </summary>
        /// <param name="value">The absolute value to set.</param>
        /// <returns>The absolute value of health.</returns>
        public static int SetHealth(int value)
        {
            if (value > MaxHealth) { return MaxHealth; }
            return value;
        }
    }
}
